<template>
    <div>
        <h1>获取 tokon&userid</h1>
    </div>
</template>

<script setup>
import { onMounted,ref } from 'vue'
import { useRoute,useRouter } from 'vue-router'
const route = useRoute();
const router = useRouter();

const token = ref('')
const userid = ref('')

onMounted(()=>{
   console.log(route.query);
   
    token.value = route.query.token
    userid.value = route.query.userid
    // console.log(token.value);
    // console.log(userid.value);
    
    localStorage.setItem('userid',userid.value)
    localStorage.setItem('token',token.value)
    console.log(localStorage.getItem('userid'));
    console.log(localStorage.getItem('token'));
    // window.location.href='http://localhost:8080/#/index';
    router.push('/'); 
})


</script>


<style scoped>


</style>